import { openBuildService } from "../../helper/service";

// 值类型为String或Object,String为url(method),Object同axios(config)参数支持相同,data和params只能为对象类型
const settings = {
  // 获取密钥
  getKey: {
    url: "/api/v1/access/access_system/get_key",
    method: "post"
  },
  // 登录
  login: {
    url: "/api/v1/access/login/do_login",
    method: "post"
  },
  //web-获取UUID（用于生成扫描二维码参数）
  qrcodeGetUUid: {
    url: "/adminc/v1/scan_login/get_uuid",
    method: "post"
  },
  //web-检查UUID是否过期并登录
  checkUUid: {
    url: "/adminc/v1/scan_login/check_uuid",
    method: "post"
  },
  // 获取用户权限
  getUserAuth: {
    url: "/api/v1/user/user/get_auths",
    method: "post"
  },
  // 获取菜单列表
  getMenuTree: {
    url: "/api/v1/user/user/get_menu",
    method: "post"
  },
  // 根据域名获取单位信息
  getCompanyByDomain: {
    url: "/api/v1/org/company/get_company_by_domain",
    method: "post"
  },
  // 发送验证码
  sendCode: {
    url: "/api/v1/access/login/create_validate_code",
    method: "post"
  },
  // 注册
  onRegister: {
    url: "/api/v1/access/login/register",
    method: "post"
  },
  // 根据单位类型/名称/域名/业务范围检查单位是否存在
  checkCompanyExists: {
    url: "/api/v1/org/company/check_company_exists",
    method: "post"
  },

  printTemplateList: {
    url: "/api/v1/rpt/rpt_templete/button_list",
    method: "post"
  },
  // 短token获取长token
  getAccessToken: {
    url: '/api/v1/access/token/get_access_token_by_short',
    method: 'post'
  },
  // 获取用户详情
  getUserInfo: {
    url: '/api/v1/user/user/get_detail',
    method: 'post'
  },
  //平台入注流程v1.7.0
  scanRegister: {
    url: '/api/v1/access/login/user_register',
    method: 'post'
  },
  //平台入驻流程v1.7.0-授权绑定账号并登录
  userThirdBind: {
    url: '/api/v1/system/p_user_third/user_third_bind',
    method: 'post'
  },
  //平台入驻流程v1.7.0-没有帐号的登录
  noUserThirdBind: {
    url: '/api/v1/system/p_user_third/do_login',
    method: 'get'
  },
  // 通过token获取用户详情
  getUserDetailByToken: {
    url: 'proxy/api/v1/user',
    method: 'get'
  }
};

export default openBuildService(settings);
